package com.ccrfid.rmc6.entity.business.visitroom;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.sql.Time;

@Entity
@Table(name = "room_visit_rule")
public class RoomVisitRuleEntity {
    private Long id;
    private Integer timeType;
    private Time startTime;
    private Time stopTime;
    private Integer minStayTime;
    private Integer maxStayTime;
    private Integer minFrequency;
    private Integer maxFrequency;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "time_type", nullable = false)
    public Integer getTimeType() {
        return timeType;
    }

    public void setTimeType(Integer timeType) {
        this.timeType = timeType;
    }

    @Basic
    @Column(name = "start_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm:ss")
    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "stop_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm:ss")
    public Time getStopTime() {
        return stopTime;
    }

    public void setStopTime(Time stopTime) {
        this.stopTime = stopTime;
    }

    @Basic
    @Column(name = "min_stay_time")
    public Integer getMinStayTime() {
        return minStayTime;
    }

    public void setMinStayTime(Integer minStayTime) {
        this.minStayTime = minStayTime;
    }

    @Basic
    @Column(name = "max_stay_time")
    public Integer getMaxStayTime() {
        return maxStayTime;
    }

    public void setMaxStayTime(Integer maxStayTime) {
        this.maxStayTime = maxStayTime;
    }

    @Basic
    @Column(name = "min_frequency")
    public Integer getMinFrequency() {
        return minFrequency;
    }

    public void setMinFrequency(Integer minFrequency) {
        this.minFrequency = minFrequency;
    }

    @Basic
    @Column(name = "max_frequency")
    public Integer getMaxFrequency() {
        return maxFrequency;
    }

    public void setMaxFrequency(Integer maxFrequency) {
        this.maxFrequency = maxFrequency;
    }
}
